﻿@model IEnumerable<MyCRM.ReadModel.ViewModels.CustomerViewModel>
@{
    ViewBag.Title = "Customers";
}

<h2>Customers</h2>

<p>@Html.ActionLink("Neuen Kunden anlegen", "CreateNewCustomer")</p>
<table>
<tr>
    <td>Customer</td>
    <td>City</td>
    <td>Street</td>
    <td></td>
</tr>
@foreach (var item in Model)
{
    <tr>
        <td>@Html.DisplayFor(model => item.LastName), @Html.DisplayFor(model => item.FirstName)</td>
        <td>@Html.DisplayFor(model => item.PostalCode) - @Html.DisplayFor(model=> item.City)</td>
        <td>@Html.DisplayFor(model => item.Street)  @Html.DisplayFor(model=>item.Number)</td>
        <td>@Html.ActionLink("Adresse ändern", "ChangeCustomerAddress", item)</td>
    </tr>
}
</table>
